package com.base.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.base.mapper.voipmapper.SmsinfoesMapper;
import com.base.po.sqlparam.SmsinfoesExamplePage;
import com.base.po.voip.Smsinfoes;
import com.base.po.voip.SmsinfoesExample;
import com.base.service.SmsinfoesService;
import com.base.utils.Produce;
import org.springframework.stereotype.Service;

@Service("smsinfoesService")
public class SmsinfoesServiceImpl implements SmsinfoesService {
	@Autowired
	SmsinfoesMapper callbackinfoesMapper;

	@Override
	public int countByExample(SmsinfoesExample example) {
		return callbackinfoesMapper.countByExample(example);
	}

	@Override
	public int deleteByExample(SmsinfoesExample example) {
		return callbackinfoesMapper.deleteByExample(example);
	}

	@Override
	public int deleteByPrimaryKey(String id) {
		if (id == null) {
			return 0;
		}
		return callbackinfoesMapper.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(String mobile, Integer num, Integer status, String city, String agentid, String apistatus) {
		Smsinfoes record = new Smsinfoes(Produce.getUUID(), mobile, num, Produce.getNowDate(), status, city, agentid,
				apistatus);
		return callbackinfoesMapper.insert(record);
	}

	@Override
	public int insertSelective(Smsinfoes record) {
		return callbackinfoesMapper.insertSelective(record);
	}

	@Override
	public List<Smsinfoes> selectByExample(SmsinfoesExample example) {
		return callbackinfoesMapper.selectByExample(example);
	}

	@Override
	public List<Smsinfoes> selectByExamplePage(SmsinfoesExamplePage example) {
		return callbackinfoesMapper.selectByExamplePage(example);
	}

	@Override
	public Smsinfoes selectByPrimaryKey(String id) {
		if (id == null) {
			return null;
		}
		return callbackinfoesMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByExampleSelective(Smsinfoes record, SmsinfoesExample example) {
		return callbackinfoesMapper.updateByExampleSelective(record, example);
	}

	@Override
	public int updateByExample(Smsinfoes record, SmsinfoesExample example) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByExample(record, example);
	}

	@Override
	public int updateByPrimaryKeySelective(Smsinfoes record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(Smsinfoes record) {
		if (record == null) {
			return 0;
		}
		if (record.getId() == null) {
			return 0;
		}
		return callbackinfoesMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<Smsinfoes> selectByAgentIDAndMobile(String agentid, String mobile) {
		
		return callbackinfoesMapper.selectByAgentIDAndMobile(agentid, mobile);
	}

}
